package zuoye;

public class Threadchar extends Thread {
	public char ch='A';

	@Override
	public void run() {
		while(ch<='Z'){
			synchronized (zuoye07.lock) {
				if(!zuoye07.flag){
					System.out.println(ch);
					ch=(char) (ch+1);
					zuoye07.lock.notify();
					zuoye07.flag=true;
				}else{
					try {
						zuoye07.lock.wait();
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
				}
			}
		}
	}
}
